<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class RubyVM::RJIT::Assembler - ruby_vm: Ruby Standard Library Documentation</title>


<script src="../../js/navigation.js" defer></script>
<script src="../../js/search.js" defer></script>
<script src="../../js/search_index.js" defer></script>
<script src="../../js/searcher.js" defer></script>
<script src="../../js/darkfish.js" defer></script>

<script src="../../js/jquery-3.2.0.min.js"></script>

<script src="../../js/vue.min.js"></script>
<script src="../../js/js.cookie.min.js"></script>

<link href="../../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../../css/rdoc.css" rel="stylesheet">
<link href="../../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../";
  var index_rel_prefix = "../../";
  var darkModeCsseHref = "../../css/rdoc-dm.css"
  var defaultModeCssHref = "../../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../../table_of_contents.html#pages">Pages</a>
    <a href="../../table_of_contents.html#classes">Classes</a>
    <a href="../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="OperandMatcher.html">RubyVM::RJIT::OperandMatcher</a>
  </ul>
</div>

        
<div id="extends-section" class="nav-section">
  <h3>Extended With Modules</h3>

  <ul class="link-list">
    <li><a class="extend" href="OperandMatcher.html">RubyVM::RJIT::OperandMatcher</a>
  </ul>
</div>

        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-add">#add</a>
    <li ><a href="#method-i-and">#and</a>
    <li ><a href="#method-i-assemble">#assemble</a>
    <li ><a href="#method-i-block">#block</a>
    <li ><a href="#method-i-call">#call</a>
    <li ><a href="#method-i-cmove">#cmove</a>
    <li ><a href="#method-i-cmovg">#cmovg</a>
    <li ><a href="#method-i-cmovge">#cmovge</a>
    <li ><a href="#method-i-cmovl">#cmovl</a>
    <li ><a href="#method-i-cmovle">#cmovle</a>
    <li ><a href="#method-i-cmovne">#cmovne</a>
    <li ><a href="#method-i-cmovnz">#cmovnz</a>
    <li ><a href="#method-i-cmovz">#cmovz</a>
    <li ><a href="#method-i-cmp">#cmp</a>
    <li ><a href="#method-i-comment">#comment</a>
    <li ><a href="#method-i-encode_mod_rm">#encode_mod_rm</a>
    <li ><a href="#method-i-imm32">#imm32</a>
    <li ><a href="#method-i-imm64">#imm64</a>
    <li ><a href="#method-i-imm8">#imm8</a>
    <li ><a href="#method-i-imm_bytes">#imm_bytes</a>
    <li ><a href="#method-i-incr_counter">#incr_counter</a>
    <li ><a href="#method-i-insn">#insn</a>
    <li ><a href="#method-i-jbe">#jbe</a>
    <li ><a href="#method-i-je">#je</a>
    <li ><a href="#method-i-jl">#jl</a>
    <li ><a href="#method-i-jmp">#jmp</a>
    <li ><a href="#method-i-jne">#jne</a>
    <li ><a href="#method-i-jnz">#jnz</a>
    <li ><a href="#method-i-jo">#jo</a>
    <li ><a href="#method-i-jz">#jz</a>
    <li ><a href="#method-i-lea">#lea</a>
    <li ><a href="#method-i-mov">#mov</a>
    <li ><a href="#method-i-new_label">#new_label</a>
    <li ><a href="#method-i-or">#or</a>
    <li ><a href="#method-i-pop">#pop</a>
    <li ><a href="#method-i-pos_marker">#pos_marker</a>
    <li ><a href="#method-i-push">#push</a>
    <li ><a href="#method-i-reg_code">#reg_code</a>
    <li ><a href="#method-i-rel32">#rel32</a>
    <li ><a href="#method-i-resolve_labels">#resolve_labels</a>
    <li ><a href="#method-i-resolve_rel32">#resolve_rel32</a>
    <li ><a href="#method-i-ret">#ret</a>
    <li ><a href="#method-i-sar">#sar</a>
    <li ><a href="#method-i-set_code_addrs">#set_code_addrs</a>
    <li ><a href="#method-i-size">#size</a>
    <li ><a href="#method-i-stub">#stub</a>
    <li ><a href="#method-i-sub">#sub</a>
    <li ><a href="#method-i-test">#test</a>
    <li ><a href="#method-i-write_bytes">#write_bytes</a>
    <li ><a href="#method-i-write_label">#write_label</a>
    <li ><a href="#method-i-xor">#xor</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-RubyVM::RJIT::Assembler">
    <h1 id="class-RubyVM::RJIT::Assembler" class="class">
      class RubyVM::RJIT::Assembler
    </h1>

    <section class="description">
    
<p><a href="https://cdrdv2.intel.com/v1/dl/getContent/671110">cdrdv2.intel.com/v1/dl/getContent/671110</a> Mostly an x86_64 assembler, but this also has some stuff that is useful for any architecture.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="IMM32">IMM32
          <dd>
          <dt id="IMM64">IMM64
          <dd>
          <dt id="IMM8">IMM8
          <dd>
          <dt id="Mod00">Mod00
          <dd>
          <dt id="Mod01">Mod01
          <dd>
          <dt id="Mod10">Mod10
          <dd>
          <dt id="Mod11">Mod11
          <dd>
          <dt id="R32">R32
          <dd><p>Operand matchers</p>
          <dt id="R64">R64
          <dd>
          <dt id="REX_B">REX_B
          <dd><p>REX =   0100WR0B</p>
          <dt id="REX_R">REX_R
          <dd>
          <dt id="REX_W">REX_W
          <dd>
          <dt id="Rel32Pad">Rel32Pad
          <dd>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-comments" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">comments</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Utilities</p>
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 45</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
  <span class="ruby-ivar">@bytes</span> = []
  <span class="ruby-ivar">@labels</span> = {}
  <span class="ruby-ivar">@label_id</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@comments</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>, <span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = [] }
  <span class="ruby-ivar">@blocks</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>, <span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = [] }
  <span class="ruby-ivar">@stub_starts</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>, <span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = [] }
  <span class="ruby-ivar">@stub_ends</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>, <span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = [] }
  <span class="ruby-ivar">@pos_markers</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>, <span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = [] }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-add" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Instructions</p>

                              <div class="method-source-code" id="add-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 79</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># ADD r/m64, imm8 (Mod 00: [reg])</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>], <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>]
    <span class="ruby-comment"># REX.W + 83 /0 ib</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r, w), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x83</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod00</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">src_imm</span>),
    )
  <span class="ruby-comment"># ADD r/m64, imm8 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>]
    <span class="ruby-comment"># REX.W + 83 /0 ib</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r, w), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x83</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">src_imm</span>),
    )
  <span class="ruby-comment"># ADD r/m64 imm32 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>]
    <span class="ruby-comment"># REX.W + 81 /0 id</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r, w), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x81</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">src_imm</span>),
    )
  <span class="ruby-comment"># ADD r/m64, r64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>]
    <span class="ruby-comment"># REX.W + 01 /r</span>
    <span class="ruby-comment"># MR: Operand 1: ModRM:r/m (r, w), Operand 2: ModRM:reg (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x01</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-and" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">and</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="and-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 123</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">and</span>(<span class="ruby-identifier ruby-title">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># AND r/m64, imm8 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>]
    <span class="ruby-comment"># REX.W + 83 /4 ib</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r, w), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x83</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">4</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">src_imm</span>),
    )
  <span class="ruby-comment"># AND r/m64, imm32 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>]
    <span class="ruby-comment"># REX.W + 81 /4 id</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r, w), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x81</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">4</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">src_imm</span>),
    )
  <span class="ruby-comment"># AND r64, r/m64 (Mod 01: [reg]+disp8)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_disp</span>]]
    <span class="ruby-comment"># REX.W + 23 /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (r, w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x23</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">src_disp</span>),
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-assemble" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">assemble</span><span
                                class="method-args">(addr)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="assemble-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 56</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">assemble</span>(<span class="ruby-identifier">addr</span>)
  <span class="ruby-identifier">set_code_addrs</span>(<span class="ruby-identifier">addr</span>)
  <span class="ruby-identifier">resolve_rel32</span>(<span class="ruby-identifier">addr</span>)
  <span class="ruby-identifier">resolve_labels</span>

  <span class="ruby-identifier">write_bytes</span>(<span class="ruby-identifier">addr</span>)

  <span class="ruby-ivar">@pos_markers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">write_pos</span>, <span class="ruby-identifier">markers</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">markers</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">marker</span><span class="ruby-operator">|</span> <span class="ruby-identifier">marker</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">addr</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">write_pos</span>) }
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">size</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">clear</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-block" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">block</span><span
                                class="method-args">(block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Mark the starting address of a block</p>

                              <div class="method-source-code" id="block-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 884</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">block</span>(<span class="ruby-identifier">block</span>)
  <span class="ruby-ivar">@blocks</span>[<span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">size</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-call" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">call</span><span
                                class="method-args">(dst)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="call-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 158</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">call</span>(<span class="ruby-identifier">dst</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">dst</span>
  <span class="ruby-comment"># CALL rel32</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Integer</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_addr</span>
    <span class="ruby-comment"># E8 cd</span>
    <span class="ruby-comment"># D: Operand 1: Offset</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0xe8</span>, <span class="ruby-value">imm:</span> <span class="ruby-identifier">rel32</span>(<span class="ruby-identifier">dst_addr</span>))
  <span class="ruby-comment"># CALL r/m64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>
    <span class="ruby-comment"># FF /2</span>
    <span class="ruby-comment"># M: Operand 1: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0xff</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">2</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cmove" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cmove</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cmove-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 176</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cmove</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># CMOVE r64, r/m64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>]
    <span class="ruby-comment"># REX.W + 0F 44 /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (r, w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x44</span>],
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cmovg" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cmovg</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cmovg-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 190</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cmovg</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># CMOVG r64, r/m64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>]
    <span class="ruby-comment"># REX.W + 0F 4F /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (r, w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x4f</span>],
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cmovge" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cmovge</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cmovge-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 204</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cmovge</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># CMOVGE r64, r/m64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>]
    <span class="ruby-comment"># REX.W + 0F 4D /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (r, w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x4d</span>],
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cmovl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cmovl</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cmovl-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 218</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cmovl</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># CMOVL r64, r/m64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>]
    <span class="ruby-comment"># REX.W + 0F 4C /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (r, w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x4c</span>],
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cmovle" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cmovle</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cmovle-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 232</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cmovle</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># CMOVLE r64, r/m64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>]
    <span class="ruby-comment"># REX.W + 0F 4E /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (r, w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x4e</span>],
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cmovne" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cmovne</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cmovne-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 246</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cmovne</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># CMOVNE r64, r/m64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>]
    <span class="ruby-comment"># REX.W + 0F 45 /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (r, w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x45</span>],
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cmovnz" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cmovnz</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cmovnz-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 260</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cmovnz</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># CMOVNZ r64, r/m64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>]
    <span class="ruby-comment"># REX.W + 0F 45 /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (r, w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x45</span>],
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cmovz" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cmovz</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cmovz-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 274</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cmovz</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># CMOVZ r64, r/m64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>]
    <span class="ruby-comment"># REX.W + 0F 44 /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (r, w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x44</span>],
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
    )
  <span class="ruby-comment"># CMOVZ r64, r/m64 (Mod 01: [reg]+disp8)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_disp</span>]]
    <span class="ruby-comment"># REX.W + 0F 44 /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (r, w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x44</span>],
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">src_disp</span>),
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cmp" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cmp</span><span
                                class="method-args">(left, right)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cmp-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 298</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cmp</span>(<span class="ruby-identifier">left</span>, <span class="ruby-identifier">right</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">left</span>, <span class="ruby-identifier">right</span>]
  <span class="ruby-comment"># CMP r/m8, imm8 (Mod 01: [reg]+disp8)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">BytePtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_disp</span>], <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_imm</span>]
    <span class="ruby-comment"># 80 /7 ib</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x80</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">7</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">left_disp</span>,
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">right_imm</span>),
    )
  <span class="ruby-comment"># CMP r/m32, imm32 (Mod 01: [reg]+disp8)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">DwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_disp</span>], <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_imm</span>]
    <span class="ruby-comment"># 81 /7 id</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x81</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">7</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">left_disp</span>,
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">right_imm</span>),
    )
  <span class="ruby-comment"># CMP r/m64, imm8 (Mod 01: [reg]+disp8)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_disp</span>], <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_imm</span>]
    <span class="ruby-comment"># REX.W + 83 /7 ib</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x83</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">7</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">left_disp</span>,
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">right_imm</span>),
    )
  <span class="ruby-comment"># CMP r/m64, imm8 (Mod 10: [reg]+disp32)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_disp</span>], <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_imm</span>]
    <span class="ruby-comment"># REX.W + 83 /7 ib</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x83</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod10</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">7</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">left_disp</span>),
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">right_imm</span>),
    )
  <span class="ruby-comment"># CMP r/m64, imm8 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_imm</span>]
    <span class="ruby-comment"># REX.W + 83 /7 ib</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x83</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">7</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">right_imm</span>),
    )
  <span class="ruby-comment"># CMP r/m64, imm32 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_imm</span>]
    <span class="ruby-comment"># REX.W + 81 /7 id</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x81</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">7</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">right_imm</span>),
    )
  <span class="ruby-comment"># CMP r/m64, r64 (Mod 01: [reg]+disp8)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_disp</span>], <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_reg</span>]
    <span class="ruby-comment"># REX.W + 39 /r</span>
    <span class="ruby-comment"># MR: Operand 1: ModRM:r/m (r), Operand 2: ModRM:reg (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x39</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">right_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">left_disp</span>,
    )
  <span class="ruby-comment"># CMP r/m64, r64 (Mod 10: [reg]+disp32)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_disp</span>], <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_reg</span>]
    <span class="ruby-comment"># REX.W + 39 /r</span>
    <span class="ruby-comment"># MR: Operand 1: ModRM:r/m (r), Operand 2: ModRM:reg (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x39</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod10</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">right_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">left_disp</span>),
    )
  <span class="ruby-comment"># CMP r/m64, r64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_reg</span>]
    <span class="ruby-comment"># REX.W + 39 /r</span>
    <span class="ruby-comment"># MR: Operand 1: ModRM:r/m (r), Operand 2: ModRM:reg (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x39</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">right_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-comment" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">comment</span><span
                                class="method-args">(message)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="comment-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 879</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">comment</span>(<span class="ruby-identifier">message</span>)
  <span class="ruby-ivar">@comments</span>[<span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">size</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">message</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-incr_counter" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">incr_counter</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="incr_counter-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 909</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">incr_counter</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-constant">C</span>.<span class="ruby-identifier">rjit_opts</span>.<span class="ruby-identifier">stats</span>
    <span class="ruby-identifier">comment</span>(<span class="ruby-node">&quot;increment counter #{name}&quot;</span>)
    <span class="ruby-identifier">mov</span>(<span class="ruby-value">:rax</span>, <span class="ruby-constant">C</span>.<span class="ruby-identifier">rb_rjit_counters</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">to_i</span>)
    <span class="ruby-identifier">add</span>([<span class="ruby-value">:rax</span>], <span class="ruby-value">1</span>) <span class="ruby-comment"># TODO: lock</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-jbe" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">jbe</span><span
                                class="method-args">(dst)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="jbe-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 394</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">jbe</span>(<span class="ruby-identifier">dst</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">dst</span>
  <span class="ruby-comment"># JBE rel8</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Label</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_label</span>
    <span class="ruby-comment"># 76 cb</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0x76</span>, <span class="ruby-value">imm:</span> <span class="ruby-identifier">dst_label</span>)
  <span class="ruby-comment"># JBE rel32</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Integer</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_addr</span>
    <span class="ruby-comment"># 0F 86 cd</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x86</span>], <span class="ruby-value">imm:</span> <span class="ruby-identifier">rel32</span>(<span class="ruby-identifier">dst_addr</span>))
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-je" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">je</span><span
                                class="method-args">(dst)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="je-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 407</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">je</span>(<span class="ruby-identifier">dst</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">dst</span>
  <span class="ruby-comment"># JE rel8</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Label</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_label</span>
    <span class="ruby-comment"># 74 cb</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0x74</span>, <span class="ruby-value">imm:</span> <span class="ruby-identifier">dst_label</span>)
  <span class="ruby-comment"># JE rel32</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Integer</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_addr</span>
    <span class="ruby-comment"># 0F 84 cd</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x84</span>], <span class="ruby-value">imm:</span> <span class="ruby-identifier">rel32</span>(<span class="ruby-identifier">dst_addr</span>))
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-jl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">jl</span><span
                                class="method-args">(dst)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="jl-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 420</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">jl</span>(<span class="ruby-identifier">dst</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">dst</span>
  <span class="ruby-comment"># JL rel32</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Integer</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_addr</span>
    <span class="ruby-comment"># 0F 8C cd</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x8c</span>], <span class="ruby-value">imm:</span> <span class="ruby-identifier">rel32</span>(<span class="ruby-identifier">dst_addr</span>))
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-jmp" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">jmp</span><span
                                class="method-args">(dst)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="jmp-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 429</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">jmp</span>(<span class="ruby-identifier">dst</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">dst</span>
  <span class="ruby-comment"># JZ rel8</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Label</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_label</span>
    <span class="ruby-comment"># EB cb</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0xeb</span>, <span class="ruby-value">imm:</span> <span class="ruby-identifier">dst_label</span>)
  <span class="ruby-comment"># JMP rel32</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Integer</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_addr</span>
    <span class="ruby-comment"># E9 cd</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0xe9</span>, <span class="ruby-value">imm:</span> <span class="ruby-identifier">rel32</span>(<span class="ruby-identifier">dst_addr</span>))
  <span class="ruby-comment"># JMP r/m64 (Mod 01: [reg]+disp8)</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_disp</span>]
    <span class="ruby-comment"># FF /4</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0xff</span>, <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">4</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>], <span class="ruby-value">disp:</span> <span class="ruby-identifier">dst_disp</span>)
  <span class="ruby-comment"># JMP r/m64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>
    <span class="ruby-comment"># FF /4</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0xff</span>, <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">4</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>])
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-jne" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">jne</span><span
                                class="method-args">(dst)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="jne-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 450</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">jne</span>(<span class="ruby-identifier">dst</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">dst</span>
  <span class="ruby-comment"># JNE rel8</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Label</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_label</span>
    <span class="ruby-comment"># 75 cb</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0x75</span>, <span class="ruby-value">imm:</span> <span class="ruby-identifier">dst_label</span>)
  <span class="ruby-comment"># JNE rel32</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Integer</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_addr</span>
    <span class="ruby-comment"># 0F 85 cd</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x85</span>], <span class="ruby-value">imm:</span> <span class="ruby-identifier">rel32</span>(<span class="ruby-identifier">dst_addr</span>))
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-jnz" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">jnz</span><span
                                class="method-args">(dst)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="jnz-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 463</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">jnz</span>(<span class="ruby-identifier">dst</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">dst</span>
  <span class="ruby-comment"># JE rel8</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Label</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_label</span>
    <span class="ruby-comment"># 75 cb</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0x75</span>, <span class="ruby-value">imm:</span> <span class="ruby-identifier">dst_label</span>)
  <span class="ruby-comment"># JNZ rel32</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Integer</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_addr</span>
    <span class="ruby-comment"># 0F 85 cd</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x85</span>], <span class="ruby-value">imm:</span> <span class="ruby-identifier">rel32</span>(<span class="ruby-identifier">dst_addr</span>))
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-jo" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">jo</span><span
                                class="method-args">(dst)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="jo-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 476</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">jo</span>(<span class="ruby-identifier">dst</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">dst</span>
  <span class="ruby-comment"># JO rel32</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Integer</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_addr</span>
    <span class="ruby-comment"># 0F 80 cd</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x80</span>], <span class="ruby-value">imm:</span> <span class="ruby-identifier">rel32</span>(<span class="ruby-identifier">dst_addr</span>))
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-jz" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">jz</span><span
                                class="method-args">(dst)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="jz-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 485</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">jz</span>(<span class="ruby-identifier">dst</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">dst</span>
  <span class="ruby-comment"># JZ rel8</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Label</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_label</span>
    <span class="ruby-comment"># 74 cb</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0x74</span>, <span class="ruby-value">imm:</span> <span class="ruby-identifier">dst_label</span>)
  <span class="ruby-comment"># JZ rel32</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">Integer</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_addr</span>
    <span class="ruby-comment"># 0F 84 cd</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> [<span class="ruby-value">0x0f</span>, <span class="ruby-value">0x84</span>], <span class="ruby-value">imm:</span> <span class="ruby-identifier">rel32</span>(<span class="ruby-identifier">dst_addr</span>))
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-lea" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">lea</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="lea-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 498</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">lea</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># LEA r64,m (Mod 01: [reg]+disp8)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_disp</span>]]
    <span class="ruby-comment"># REX.W + 8D /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x8d</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">src_disp</span>),
    )
  <span class="ruby-comment"># LEA r64,m (Mod 10: [reg]+disp32)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_disp</span>]]
    <span class="ruby-comment"># REX.W + 8D /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x8d</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod10</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">src_disp</span>),
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-mov" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">mov</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="mov-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 523</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">mov</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">dst</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">R32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">src</span>
    <span class="ruby-comment"># MOV r32 r/m32 (Mod 01: [reg]+disp8)</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">DwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_disp</span>]
      <span class="ruby-comment"># 8B /r</span>
      <span class="ruby-comment"># RM: Operand 1: ModRM:reg (w), Operand 2: ModRM:r/m (r)</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0x8b</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
        <span class="ruby-value">disp:</span> <span class="ruby-identifier">src_disp</span>,
      )
    <span class="ruby-comment"># MOV r32, imm32 (Mod 11: reg)</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>
      <span class="ruby-comment"># B8+ rd id</span>
      <span class="ruby-comment"># OI: Operand 1: opcode + rd (w), Operand 2: imm8/16/32/64</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0xb8</span>,
        <span class="ruby-value">rd:</span> <span class="ruby-identifier">dst_reg</span>,
        <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">src_imm</span>),
      )
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">src</span>
    <span class="ruby-comment"># MOV r64, r/m64 (Mod 00: [reg])</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>]
      <span class="ruby-comment"># REX.W + 8B /r</span>
      <span class="ruby-comment"># RM: Operand 1: ModRM:reg (w), Operand 2: ModRM:r/m (r)</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0x8b</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod00</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
      )
    <span class="ruby-comment"># MOV r64, r/m64 (Mod 01: [reg]+disp8)</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_disp</span>]
      <span class="ruby-comment"># REX.W + 8B /r</span>
      <span class="ruby-comment"># RM: Operand 1: ModRM:reg (w), Operand 2: ModRM:r/m (r)</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0x8b</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
        <span class="ruby-value">disp:</span> <span class="ruby-identifier">src_disp</span>,
      )
    <span class="ruby-comment"># MOV r64, r/m64 (Mod 10: [reg]+disp32)</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_disp</span>]
      <span class="ruby-comment"># REX.W + 8B /r</span>
      <span class="ruby-comment"># RM: Operand 1: ModRM:reg (w), Operand 2: ModRM:r/m (r)</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0x8b</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod10</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
        <span class="ruby-value">disp:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">src_disp</span>),
      )
    <span class="ruby-comment"># MOV r64, r/m64 (Mod 11: reg)</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>
      <span class="ruby-comment"># REX.W + 8B /r</span>
      <span class="ruby-comment"># RM: Operand 1: ModRM:reg (w), Operand 2: ModRM:r/m (r)</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0x8b</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
      )
    <span class="ruby-comment"># MOV r/m64, imm32 (Mod 11: reg)</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>
      <span class="ruby-comment"># REX.W + C7 /0 id</span>
      <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (w), Operand 2: imm8/16/32/64</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0xc7</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
        <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">src_imm</span>),
      )
    <span class="ruby-comment"># MOV r64, imm64</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">IMM64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>
      <span class="ruby-comment"># REX.W + B8+ rd io</span>
      <span class="ruby-comment"># OI: Operand 1: opcode + rd (w), Operand 2: imm8/16/32/64</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0xb8</span>,
        <span class="ruby-value">rd:</span> <span class="ruby-identifier">dst_reg</span>,
        <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm64</span>(<span class="ruby-identifier">src_imm</span>),
      )
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">DwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_disp</span>]
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">src</span>
    <span class="ruby-comment"># MOV r/m32, imm32 (Mod 01: [reg]+disp8)</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>
      <span class="ruby-comment"># C7 /0 id</span>
      <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (w), Operand 2: imm8/16/32/64</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0xc7</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
        <span class="ruby-value">disp:</span> <span class="ruby-identifier">dst_disp</span>,
        <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">src_imm</span>),
      )
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>]
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">src</span>
    <span class="ruby-comment"># MOV r/m64, imm32 (Mod 00: [reg])</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>
      <span class="ruby-comment"># REX.W + C7 /0 id</span>
      <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (w), Operand 2: imm8/16/32/64</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0xc7</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod00</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
        <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">src_imm</span>),
      )
    <span class="ruby-comment"># MOV r/m64, r64 (Mod 00: [reg])</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>
      <span class="ruby-comment"># REX.W + 89 /r</span>
      <span class="ruby-comment"># MR: Operand 1: ModRM:r/m (w), Operand 2: ModRM:reg (r)</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0x89</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod00</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
      )
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_disp</span>]
    <span class="ruby-comment"># Optimize encoding when disp is 0</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">mov</span>([<span class="ruby-identifier">dst_reg</span>], <span class="ruby-identifier">src</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">dst_disp</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>

    <span class="ruby-keyword">case</span> <span class="ruby-identifier">src</span>
    <span class="ruby-comment"># MOV r/m64, imm32 (Mod 01: [reg]+disp8)</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>
      <span class="ruby-comment"># REX.W + C7 /0 id</span>
      <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (w), Operand 2: imm8/16/32/64</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0xc7</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
        <span class="ruby-value">disp:</span> <span class="ruby-identifier">dst_disp</span>,
        <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">src_imm</span>),
      )
    <span class="ruby-comment"># MOV r/m64, r64 (Mod 01: [reg]+disp8)</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>
      <span class="ruby-comment"># REX.W + 89 /r</span>
      <span class="ruby-comment"># MR: Operand 1: ModRM:r/m (w), Operand 2: ModRM:reg (r)</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0x89</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
        <span class="ruby-value">disp:</span> <span class="ruby-identifier">dst_disp</span>,
      )
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_disp</span>]
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">src</span>
    <span class="ruby-comment"># MOV r/m64, imm32 (Mod 10: [reg]+disp32)</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>
      <span class="ruby-comment"># REX.W + C7 /0 id</span>
      <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (w), Operand 2: imm8/16/32/64</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0xc7</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod10</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
        <span class="ruby-value">disp:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">dst_disp</span>),
        <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">src_imm</span>),
      )
    <span class="ruby-comment"># MOV r/m64, r64 (Mod 10: [reg]+disp32)</span>
    <span class="ruby-keyword">in</span> <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>
      <span class="ruby-comment"># REX.W + 89 /r</span>
      <span class="ruby-comment"># MR: Operand 1: ModRM:r/m (w), Operand 2: ModRM:reg (r)</span>
      <span class="ruby-identifier">insn</span>(
        <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
        <span class="ruby-value">opcode:</span> <span class="ruby-value">0x89</span>,
        <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod10</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
        <span class="ruby-value">disp:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">dst_disp</span>),
      )
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-new_label" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new_label</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new_label-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 900</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">new_label</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-constant">Label</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">id:</span> <span class="ruby-ivar">@label_id</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>, <span class="ruby-value">name:</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-or" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">or</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="or-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 696</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">or</span>(<span class="ruby-identifier ruby-title">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># OR r/m64, imm8 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>]
    <span class="ruby-comment"># REX.W + 83 /1 ib</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r, w), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x83</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">1</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">src_imm</span>),
    )
  <span class="ruby-comment"># OR r/m64, imm32 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>]
    <span class="ruby-comment"># REX.W + 81 /1 id</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r, w), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x81</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">1</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">src_imm</span>),
    )
  <span class="ruby-comment"># OR r64, r/m64 (Mod 01: [reg]+disp8)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_disp</span>]]
    <span class="ruby-comment"># REX.W + 0B /r</span>
    <span class="ruby-comment"># RM: Operand 1: ModRM:reg (r, w), Operand 2: ModRM:r/m (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x0b</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">src_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">src_disp</span>),
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-pop" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">pop</span><span
                                class="method-args">(dst)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="pop-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 741</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pop</span>(<span class="ruby-identifier">dst</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">dst</span>
  <span class="ruby-comment"># POP r64</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>
    <span class="ruby-comment"># 58+ rd</span>
    <span class="ruby-comment"># O: Operand 1: opcode + rd (r)</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0x58</span>, <span class="ruby-value">rd:</span> <span class="ruby-identifier">dst_reg</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-pos_marker" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">pos_marker</span><span
                                class="method-args">(&amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="pos_marker-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 896</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pos_marker</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-ivar">@pos_markers</span>[<span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">size</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-push" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">push</span><span
                                class="method-args">(src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="push-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 731</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">push</span>(<span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">src</span>
  <span class="ruby-comment"># PUSH r64</span>
  <span class="ruby-keyword">in</span> <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>
    <span class="ruby-comment"># 50+rd</span>
    <span class="ruby-comment"># O: Operand 1: opcode + rd (r)</span>
    <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0x50</span>, <span class="ruby-value">rd:</span> <span class="ruby-identifier">src_reg</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ret" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ret</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ret-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 751</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ret</span>
  <span class="ruby-comment"># RET</span>
  <span class="ruby-comment"># Near return: A return to a procedure within the current code segment</span>
  <span class="ruby-identifier">insn</span>(<span class="ruby-value">opcode:</span> <span class="ruby-value">0xc3</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-sar" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">sar</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="sar-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 757</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sar</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>]
    <span class="ruby-comment"># REX.W + C1 /7 ib</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r, w), Operand 2: imm8</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0xc1</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">7</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">src_imm</span>),
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-size" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">size</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="size-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 71</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">size</span>
  <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">size</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-stub" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">stub</span><span
                                class="method-args">(stub) { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Mark the starting/ending addresses of a stub</p>

                              <div class="method-source-code" id="stub-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 889</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">stub</span>(<span class="ruby-identifier">stub</span>)
  <span class="ruby-ivar">@stub_starts</span>[<span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">size</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">stub</span>
  <span class="ruby-keyword">yield</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@stub_ends</span>[<span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">size</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">stub</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-sub" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">sub</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="sub-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 771</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sub</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># SUB r/m64, imm8 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_imm</span>]
    <span class="ruby-comment"># REX.W + 83 /5 ib</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r, w), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x83</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">5</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">src_imm</span>),
    )
  <span class="ruby-comment"># SUB r/m64, r64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>]
    <span class="ruby-comment"># REX.W + 29 /r</span>
    <span class="ruby-comment"># MR: Operand 1: ModRM:r/m (r, w), Operand 2: ModRM:reg (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x29</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-test" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">test</span><span
                                class="method-args">(left, right)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="test-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 795</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test</span>(<span class="ruby-identifier">left</span>, <span class="ruby-identifier">right</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">left</span>, <span class="ruby-identifier">right</span>]
  <span class="ruby-comment"># TEST r/m8*, imm8 (Mod 01: [reg]+disp8)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">BytePtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_disp</span>], <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_imm</span>]
    <span class="ruby-comment"># REX + F6 /0 ib</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0xf6</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">left_disp</span>,
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm8</span>(<span class="ruby-identifier">right_imm</span>),
    )
  <span class="ruby-comment"># TEST r/m64, imm32 (Mod 01: [reg]+disp8)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">IMM8</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_disp</span>], <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_imm</span>]
    <span class="ruby-comment"># REX.W + F7 /0 id</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0xf7</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod01</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">left_disp</span>,
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">right_imm</span>),
    )
  <span class="ruby-comment"># TEST r/m64, imm32 (Mod 10: [reg]+disp32)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">QwordPtr</span>[<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_disp</span>], <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_imm</span>]
    <span class="ruby-comment"># REX.W + F7 /0 id</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0xf7</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod10</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
      <span class="ruby-value">disp:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">left_disp</span>),
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">right_imm</span>),
    )
  <span class="ruby-comment"># TEST r/m64, imm32 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">IMM32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_imm</span>]
    <span class="ruby-comment"># REX.W + F7 /0 id</span>
    <span class="ruby-comment"># MI: Operand 1: ModRM:r/m (r), Operand 2: imm8/16/32</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0xf7</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
      <span class="ruby-value">imm:</span> <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">right_imm</span>),
    )
  <span class="ruby-comment"># TEST r/m32, r32 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">R32</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_reg</span>]
    <span class="ruby-comment"># 85 /r</span>
    <span class="ruby-comment"># MR: Operand 1: ModRM:r/m (r), Operand 2: ModRM:reg (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x85</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">right_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
    )
  <span class="ruby-comment"># TEST r/m64, r64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">left_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">right_reg</span>]
    <span class="ruby-comment"># REX.W + 85 /r</span>
    <span class="ruby-comment"># MR: Operand 1: ModRM:r/m (r), Operand 2: ModRM:reg (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x85</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">right_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">left_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-write_label" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">write_label</span><span
                                class="method-args">(label)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>@param [RubyVM::RJIT::Assembler::Label] label</p>

                              <div class="method-source-code" id="write_label-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 905</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">write_label</span>(<span class="ruby-identifier">label</span>)
  <span class="ruby-ivar">@labels</span>[<span class="ruby-identifier">label</span>] = <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">size</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-xor" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">xor</span><span
                                class="method-args">(dst, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="xor-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 859</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">xor</span>(<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-keyword">case</span> [<span class="ruby-identifier">dst</span>, <span class="ruby-identifier">src</span>]
  <span class="ruby-comment"># XOR r/m64, r64 (Mod 11: reg)</span>
  <span class="ruby-keyword">in</span> [<span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">dst_reg</span>, <span class="ruby-constant">R64</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">src_reg</span>]
    <span class="ruby-comment"># REX.W + 31 /r</span>
    <span class="ruby-comment"># MR: Operand 1: ModRM:r/m (r, w), Operand 2: ModRM:reg (r)</span>
    <span class="ruby-identifier">insn</span>(
      <span class="ruby-value">prefix:</span> <span class="ruby-constant">REX_W</span>,
      <span class="ruby-value">opcode:</span> <span class="ruby-value">0x31</span>,
      <span class="ruby-value">mod_rm:</span> <span class="ruby-constant">ModRM</span>[<span class="ruby-value">mod:</span> <span class="ruby-constant">Mod11</span>, <span class="ruby-value">reg:</span> <span class="ruby-identifier">src_reg</span>, <span class="ruby-value">rm:</span> <span class="ruby-identifier">dst_reg</span>],
    )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-encode_mod_rm" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">encode_mod_rm</span><span
                                class="method-args">(mod:, reg: 0, rm: 0)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Table 2-2. 32-Bit Addressing Forms with the ModR/M Byte</p>

<pre>7  6  5  4  3  2  1  0</pre>

<p><code>--</code>–<code>--</code>–<code>--</code>–<code>--</code>–+ | Mod | Reg/   | R/M    | |     | Opcode |        | <code>--</code>–<code>--</code>–<code>--</code>–<code>--</code>–+</p>

<p>The r/m field can specify a register as an operand or it can be combined with the mod field to encode an addressing mode.</p>

<p>/0: R/M is 0 (not used) /r: R/M is a register</p>

                              <div class="method-source-code" id="encode_mod_rm-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 968</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">encode_mod_rm</span>(<span class="ruby-value">mod:</span>, <span class="ruby-value">reg:</span> <span class="ruby-value">0</span>, <span class="ruby-value">rm:</span> <span class="ruby-value">0</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">mod</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0b11</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;too large Mod: #{mod}&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">reg</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0b111</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;too large Reg/Opcode: #{reg}&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">rm</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0b111</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;too large R/M: #{rm}&quot;</span>
  <span class="ruby-keyword">end</span>
  (<span class="ruby-identifier">mod</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">6</span>) <span class="ruby-operator">+</span> (<span class="ruby-identifier">reg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">3</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">rm</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-imm32" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">imm32</span><span
                                class="method-args">(imm)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>id: 4 bytes</p>

                              <div class="method-source-code" id="imm32-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 990</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">imm32</span>(<span class="ruby-identifier">imm</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">imm32?</span>(<span class="ruby-identifier">imm</span>)
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;unexpected imm32: #{imm}&quot;</span>
  <span class="ruby-keyword">end</span>
  [<span class="ruby-identifier">imm</span>].<span class="ruby-identifier">pack</span>(<span class="ruby-string">&#39;l&#39;</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-string">&#39;c*&#39;</span>) <span class="ruby-comment"># TODO: consider uimm</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-imm64" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">imm64</span><span
                                class="method-args">(imm)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>io: 8 bytes</p>

                              <div class="method-source-code" id="imm64-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 998</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">imm64</span>(<span class="ruby-identifier">imm</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">imm64?</span>(<span class="ruby-identifier">imm</span>)
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;unexpected imm64: #{imm}&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">imm_bytes</span>(<span class="ruby-identifier">imm</span>, <span class="ruby-value">8</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-imm8" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">imm8</span><span
                                class="method-args">(imm)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>ib: 1 byte</p>

                              <div class="method-source-code" id="imm8-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 982</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">imm8</span>(<span class="ruby-identifier">imm</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">imm8?</span>(<span class="ruby-identifier">imm</span>)
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;unexpected imm8: #{imm}&quot;</span>
  <span class="ruby-keyword">end</span>
  [<span class="ruby-identifier">imm</span>].<span class="ruby-identifier">pack</span>(<span class="ruby-string">&#39;c&#39;</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-string">&#39;c*&#39;</span>) <span class="ruby-comment"># TODO: consider uimm</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-imm_bytes" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">imm_bytes</span><span
                                class="method-args">(imm, num_bytes)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="imm_bytes-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 1005</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">imm_bytes</span>(<span class="ruby-identifier">imm</span>, <span class="ruby-identifier">num_bytes</span>)
  <span class="ruby-identifier">bytes</span> = []
  <span class="ruby-identifier">bits</span> = <span class="ruby-identifier">imm</span>
  <span class="ruby-identifier">num_bytes</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">bytes</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">bits</span> <span class="ruby-operator">&amp;</span> <span class="ruby-value">0xff</span>)
    <span class="ruby-identifier">bits</span> <span class="ruby-operator">&gt;&gt;=</span> <span class="ruby-value">8</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">bits</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;unexpected imm with #{num_bytes} bytes: #{imm}&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">bytes</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-insn" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">insn</span><span
                                class="method-args">(prefix: 0, opcode:, rd: nil, mod_rm: nil, disp: nil, imm: nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="insn-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 919</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insn</span>(<span class="ruby-value">prefix:</span> <span class="ruby-value">0</span>, <span class="ruby-value">opcode:</span>, <span class="ruby-value">rd:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">mod_rm:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">disp:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">imm:</span> <span class="ruby-keyword">nil</span>)
  <span class="ruby-comment"># Determine prefix</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">rd</span>
    <span class="ruby-identifier">prefix</span> <span class="ruby-operator">|=</span> <span class="ruby-constant">REX_B</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">extended_reg?</span>(<span class="ruby-identifier">rd</span>)
    <span class="ruby-identifier">opcode</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">reg_code</span>(<span class="ruby-identifier">rd</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">mod_rm</span>
    <span class="ruby-identifier">prefix</span> <span class="ruby-operator">|=</span> <span class="ruby-constant">REX_R</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mod_rm</span>.<span class="ruby-identifier">reg</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">extended_reg?</span>(<span class="ruby-identifier">mod_rm</span>.<span class="ruby-identifier">reg</span>)
    <span class="ruby-identifier">prefix</span> <span class="ruby-operator">|=</span> <span class="ruby-constant">REX_B</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mod_rm</span>.<span class="ruby-identifier">rm</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">extended_reg?</span>(<span class="ruby-identifier">mod_rm</span>.<span class="ruby-identifier">rm</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># Encode insn</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">prefix</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">prefix</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">push</span>(<span class="ruby-operator">*</span><span class="ruby-constant">Array</span>(<span class="ruby-identifier">opcode</span>))
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">mod_rm</span>
    <span class="ruby-identifier">mod_rm_byte</span> = <span class="ruby-identifier">encode_mod_rm</span>(
      <span class="ruby-value">mod:</span> <span class="ruby-identifier">mod_rm</span>.<span class="ruby-identifier">mod</span>,
      <span class="ruby-value">reg:</span> <span class="ruby-identifier">mod_rm</span>.<span class="ruby-identifier">reg</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">reg_code</span>(<span class="ruby-identifier">mod_rm</span>.<span class="ruby-identifier">reg</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">mod_rm</span>.<span class="ruby-identifier">reg</span>,
      <span class="ruby-value">rm:</span> <span class="ruby-identifier">mod_rm</span>.<span class="ruby-identifier">rm</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">reg_code</span>(<span class="ruby-identifier">mod_rm</span>.<span class="ruby-identifier">rm</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">mod_rm</span>.<span class="ruby-identifier">rm</span>,
    )
    <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">mod_rm_byte</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">disp</span>
    <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">push</span>(<span class="ruby-operator">*</span><span class="ruby-constant">Array</span>(<span class="ruby-identifier">disp</span>))
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">imm</span>
    <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">push</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">imm</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reg_code" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reg_code</span><span
                                class="method-args">(reg)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="reg_code-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 951</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reg_code</span>(<span class="ruby-identifier">reg</span>)
  <span class="ruby-identifier">reg_code_extended</span>(<span class="ruby-identifier">reg</span>).<span class="ruby-identifier">first</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-rel32" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">rel32</span><span
                                class="method-args">(addr)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="rel32-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 1018</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">rel32</span>(<span class="ruby-identifier">addr</span>)
  [<span class="ruby-constant">Rel32</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">addr</span>), <span class="ruby-constant">Rel32Pad</span>, <span class="ruby-constant">Rel32Pad</span>, <span class="ruby-constant">Rel32Pad</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_labels" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_labels</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_labels-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 1050</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_labels</span>
  <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">byte</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">byte</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Label</span>)
      <span class="ruby-identifier">src_index</span> = <span class="ruby-identifier">index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span> <span class="ruby-comment"># offset 1 byte for rel8 itself</span>
      <span class="ruby-identifier">dst_index</span> = <span class="ruby-ivar">@labels</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">byte</span>)
      <span class="ruby-identifier">rel8</span> = <span class="ruby-identifier">dst_index</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">src_index</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;unexpected offset: #{rel8}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">imm8?</span>(<span class="ruby-identifier">rel8</span>)
      <span class="ruby-ivar">@bytes</span>[<span class="ruby-identifier">index</span>] = <span class="ruby-identifier">rel8</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_rel32" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_rel32</span><span
                                class="method-args">(write_addr)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_rel32-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 1036</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_rel32</span>(<span class="ruby-identifier">write_addr</span>)
  <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">byte</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">byte</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Rel32</span>)
      <span class="ruby-identifier">src_addr</span> = <span class="ruby-identifier">write_addr</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">index</span> <span class="ruby-operator">+</span> <span class="ruby-value">4</span> <span class="ruby-comment"># offset 4 bytes for rel32 itself</span>
      <span class="ruby-identifier">dst_addr</span> = <span class="ruby-identifier">byte</span>.<span class="ruby-identifier">addr</span>
      <span class="ruby-identifier">rel32</span> = <span class="ruby-identifier">dst_addr</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">src_addr</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;unexpected offset: #{rel32}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">imm32?</span>(<span class="ruby-identifier">rel32</span>)
      <span class="ruby-identifier">imm32</span>(<span class="ruby-identifier">rel32</span>).<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">rel_byte</span>, <span class="ruby-identifier">rel_index</span><span class="ruby-operator">|</span>
        <span class="ruby-ivar">@bytes</span>[<span class="ruby-identifier">index</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">rel_index</span>] = <span class="ruby-identifier">rel_byte</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_code_addrs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_code_addrs</span><span
                                class="method-args">(write_addr)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_code_addrs-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 1022</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_code_addrs</span>(<span class="ruby-identifier">write_addr</span>)
  (<span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@blocks</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">index</span>, []).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">block</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">block</span>.<span class="ruby-identifier">start_addr</span> = <span class="ruby-identifier">write_addr</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">index</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@stub_starts</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">index</span>, []).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">stub</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">stub</span>.<span class="ruby-identifier">start_addr</span> = <span class="ruby-identifier">write_addr</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">index</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@stub_ends</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">index</span>, []).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">stub</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">stub</span>.<span class="ruby-identifier">end_addr</span> = <span class="ruby-identifier">write_addr</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">index</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-write_bytes" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">write_bytes</span><span
                                class="method-args">(addr)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="write_bytes-source">
            <pre><span class="ruby-comment"># File ruby_vm/rjit/assembler.rb, line 1062</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">write_bytes</span>(<span class="ruby-identifier">addr</span>)
  <span class="ruby-constant">Fiddle</span><span class="ruby-operator">::</span><span class="ruby-constant">Pointer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">addr</span>)[<span class="ruby-value">0</span>, <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">size</span>] = <span class="ruby-ivar">@bytes</span>.<span class="ruby-identifier">pack</span>(<span class="ruby-string">&#39;c*&#39;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

